-- This script was generated by the Schema Diff utility in pgAdmin 4
-- For the circular dependencies, the order in which Schema Diff writes the objects is not very sophisticated
-- and may require manual changes to the script to ensure changes are applied in the correct order.
-- Please report an issue for any failure with the reproduction steps.

CREATE OR REPLACE FUNCTION public.date_count(IN time_increment text,IN prev_period text)
    RETURNS SETOF record
    LANGUAGE 'sql'
    VOLATILE
    PARALLEL UNSAFE
    COST 100    ROWS 1000 
    
AS $BODY$
   select DATE_TRUNC(time_increment, created_at) as created_at_trunc, COUNT(*) from request_rbac request group by DATE_TRUNC(time_increment, created_at) having DATE_TRUNC(time_increment, created_at) >= CAST(prev_period AS TIMESTAMP) order by created_at_trunc
$BODY$;
